package com.ywjt.platformbusiness.store.adapter;

import android.widget.TextView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ywjt.platformbusiness.R;
import com.ywjt.platformbusiness.store.model.MonthSelectModel;

import java.util.List;

public class InComeMonthSelectAdapter extends BaseQuickAdapter<MonthSelectModel, BaseViewHolder> {

    public InComeMonthSelectAdapter(@Nullable List<MonthSelectModel> data) {
        super(R.layout.item_month_select, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MonthSelectModel item) {
        TextView tvMonth=helper.getView(R.id.tvMonth);
        tvMonth.setText(item.getMonth());
        if (item.getSelect()){
            tvMonth.setTextColor(mContext.getResources().getColor(R.color.white));
            tvMonth.setBackgroundResource(R.drawable.red_bg_4);
        }else {
            tvMonth.setBackgroundResource(0);
            tvMonth.setTextColor(mContext.getResources().getColor(R.color.black));
        }
    }
}
